package com.swt.hutool.hutooldemo;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.Console;

import java.util.Date;
import java.util.List;

public class HutoolConvert {
    public static void main(String[] args) {

        //转换为字符串
        int a=1;
        String aStr = Convert.toStr(a);
        System.err.println(aStr);

        //转换为指定类型数组
        String [] b={"1","2","3","4"};
        Integer[] bArr = Convert.toIntArray(b);
        System.err.println(bArr);
        Console.log(bArr);

        //转换为日期对象
        String dateStr="2017-05-06";
        Date date = Convert.toDate(dateStr);
        System.err.println(date);

        //转换为列表
        String [] strArr={"a","b","c","d"};
        List<?> objects = Convert.toList(strArr);
        System.err.println(objects);
        List<String> strings = Convert.toList(String.class, strArr);
        System.err.println(strings);



    }
}
